<?php
/**
 * Created by PhpStorm.
 * User: xunuo
 * Date: 2017/6/23
 * Time: 15:41
 */

namespace app\company\controller;

use think\Controller;

class Common extends Controller
{
    protected function _initialize()
    {
        $request = \think\Request::instance();
        $method  = $request->method();
        define('IS_GET', $method == 'GET' ? true : false);
        define('IS_POST', $method == 'POST' ? true : false);
        if (empty(session('company'))) {
            $this->redirect('Open/login');
        }
        $host = input('server.SERVER_PORT') == 443 ? 'https://' : 'http://' . input('server.HTTP_HOST');
        $this->assign('host', $host);
    }
}
